﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

using vJine.Core.ORM;

namespace vJineCore_QuickStart.BML {

    [Serializable]
    public class TYPES<T> where T : struct {
        public static readonly string Name = Class<T>.Name;

        [XmlAttribute]
        public T F { get; set; }

        [XmlAttribute]
        public T? N { get; set; }

        public class _ {
            public static readonly Property<TYPES<T>, T> F = new Property<TYPES<T>, T>("F");

            public static readonly Property<TYPES<T>, T?> N = new Property<TYPES<T>, T?>("N");
        }
    }

    [Serializable]
    public class TYPES_STRING {
        public static readonly string Name = "STRING";

        [XmlAttribute]
        public string F { get; set; }

        [XmlAttribute, Map(IsNullable = true)]
        public string N { get; set; }

        public class _ {
            public static readonly Property<TYPES_STRING, string> F = new Property<TYPES_STRING, string>("F");

            public static readonly Property<TYPES_STRING, string> N = new Property<TYPES_STRING, string>("N");
        }
    }

    [Serializable]
    public class TYPES_BYTES {
        public static readonly string Name = "BYTES";

        public TYPES_BYTES() {
            this.F = new byte[] { 0x0A, 0x0B };
        }
        [XmlAttribute]
        public byte[] F {
            get;
            set;
        }

        [XmlAttribute, Map(IsNullable = true)]
        public byte[] N {
            get;
            set;
        }

        public class _ {
            public static readonly Property<TYPES_BYTES, byte[]> F = new Property<TYPES_BYTES, byte[]>("F");

            public static readonly Property<TYPES_BYTES, byte[]> N = new Property<TYPES_BYTES, byte[]>("N");
        }
    }

    [Flags]
    public enum MyEnum : byte {
        Default = 0,
        Hello = 1,
        World = 2
    }

    [Flags]
    public enum BYTE : byte {
        Default = 0,
        Hello = 1,
        World = 2
    }

    [Flags]
    public enum SBYTE : sbyte {
        Default = 0,
        Hello = 1,
        World = 2
    }

    [Flags]
    public enum SHORT : short {
        Default = 0,
        Hello = 1,
        World = 2
    }

    [Flags]
    public enum USHORT : ushort {
        Default = 0,
        Hello = 1,
        World = 2
    }

    [Flags]
    public enum INT : int {
        Default = 0,
        Hello = 1,
        World = 2
    }

    [Flags]
    public enum UINT : uint {
        Default = 0,
        Hello = 1,
        World = 2
    }

    [Flags]
    public enum LONG : long {
        Default = 0,
        Hello = 1,
        World = 2
    }

    [Flags]
    public enum ULONG : ulong {
        Default = 0,
        Hello = 1,
        World = 2
    }
}
